<?php


class Configuracao {
    public function dateToBR($dataAmericana){
        //2014-08-25
        $d = explode('-', $dataAmericana);
        $dOK = $d[2].'/'.$d[1].'/'.$d[0];
        return $dOK;
        
    }
    public function dateToUS($dataBrasil){
        //25/08/2014
        $d = explode('/', $dataBrasil);
        $dOK = $d[2].'-'.$d[1].'-'.$d[0];
        return $dOK;
        
        
    }
    public function SomarData($data, $dias, $meses = 0, $ano = 0)
    {
       //passe a data no formato yyyy-mm-dd
       $data = explode("-", $data);
       $newData = date("Y-m-d", mktime(0, 0, 0, $data[1] + $meses, $data[2] + $dias, $data[0] + $ano) );
       return $newData;
    }
}
